/**
 * 这是程序的默认配置，可以理解为app的配置
 */
const path=require("path");

exports.cluster = {
    listen: {
      path: '',
      port: 80,
      hostname: '0.0.0.0',
    }
};

exports.view = {
    mapping: {
        '.html': 'arttemplate',
    },
};

exports.keys = "snsfi_abcdefg";

exports.multipart = {
    fileSize: '50mb',
    mode:"file",
    tmpdir:path.join(__dirname,"../app/uploadImgs")
};

// config/config.${env}.js
exports.mysql = {
    // 单数据库信息配置
    client: {
        host: '127.0.0.1',
        port: '3306',
        user: 'root',
        password: 'aaabbb',
        database: 'shopmall',
        multipleStatements:true
    },
    // 是否加载到 app 上，默认开启
    app: true,
    // 是否加载到 agent 上，默认关闭
    agent: false,
};


exports.static={
    prefix: '/public/',
    dir:[
        path.join(__dirname,"../app/public"),
        {
            prefix:"/uploadImgs/",
            dir:path.join(__dirname,"../app/uploadImgs")
        },{
            prefix:"/excelDirectory/",
            dir:path.join(__dirname,"../app/excelDirectory")
        },{
            prefix:"/goodsImgs/",
            dir:path.join(__dirname,"../app/goodsImgs")
        },{
            prefix:"/customerPhoto/",
            dir:path.join(__dirname,"../app/customerPhoto")
        }
    ]
}

//配置中间件
exports.middleware = ['auth'];